package cn.edu.nyist.integration.service.impl;

import cn.edu.nyist.integration.common.ServerResponse;
import cn.edu.nyist.integration.mapper.LogInfoMapper;
import cn.edu.nyist.integration.service.LogInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogInfoServiceImpl implements LogInfoService {
    @Autowired
    private LogInfoMapper logInfoMapper;

    @Override
    public ServerResponse deleteLog(Integer logId) {
        if (logId==null){
            return ServerResponse.createByErrorMessage("日志不存在");
        }
        int rowCount = logInfoMapper.deleteById(logId);
        if (rowCount>0){
            return ServerResponse.createBySuccess();
        }
      return ServerResponse.createByErrorMessage("删除失败，请重试");
    }
}
